<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	import="software.Pos_search"
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>软件开发交流平台</title>
	<!--
	-->
  </head>
  <body>
 	<jsp:include page="head.jsp" />
 	<%
 		String Content=request.getParameter("search_con");
 		int Page=1,Tol_item=0,Cur_item=0;
		Pos_search P_search=new Pos_search();
 		try{
 			Page=Integer.parseInt(request.getParameter("page"));
 			Content=request.getParameter("key");
 		}catch(Exception e){
 		}
 		if(Content!=null){
 			P_search.setKey(Content);
 			P_search.setPage(Page);
 			P_search.Search();
 			Tol_item=P_search.getSum();
 			Cur_item=P_search.getPage_Sum();
 		}
 	%>
 	 <div style="width:1024px; height:705px; background:url(/ceshi/images/search/content_bg.gif); margin-left:auto; margin-right:auto;">
         <div style=" background:url(/ceshi/images/search/content_left.gif) no-repeat; width:165px; height:414px; float:left;"></div>
      	 <div style="width:695px; float:left;">
         	<div style=" width:696px; height:49px; float:left;">
            	<img src="/ceshi/images/search/content_top.gif" width="696" height="49"/>
            </div>
            <div style="background:url(/ceshi/images/search/content_center_bg.gif); width:696px; height:550px;">
            <table width="630" border="0" cellspacing="0" height="<%=(2+Cur_item)*40%>" cellpadding="0"  style=" margin-left:50px;">
              <tr  >
                <td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总记录数：<%=Tol_item %></td>
              </tr>
              <tr height="30">
                <td width="40" align="center">序号</td>
                <td width="500" align="center">标题</td>
                <td width="100" align="center">作者</td>
              </tr>
              <%
              int i=0;
              	for( i=0;i<Cur_item;i++)
              	{
              		P_search.NextItem();
              %>
              <tr>
                <td align="center"><%=i+1 %></td>
                <td align="center"><a href="post.jsp?id=<%=P_search.getID_Post() %>"> <%=P_search.getTitle() %></a></td>
                <td align="center"><%=P_search.getName() %></td>
              </tr>
              <%}%>
            </table>
            <div style="margin-left:60px;margin-top:<%=(10-Cur_item)*40%>px;">
			<% 
				int Tot_page=(Tol_item-1)/10+1;
				if (Tot_page>=1){
				out.print("当前第"+Page+"页　");
				out.print("共"+Tot_page+"页　");
				if(Page!=1) {
				  out.print("<a href=search.jsp?key="+Content+"&page="+1+">首页</a>　");
				  out.print("<a href=search.jsp?key="+Content+"&page="+(Page-1)+">上一页</a>　");
				 }
				if(Page!=Tot_page){
				 out.print("<a href=search.jsp?key="+Content+"&page="+(Page+1)+">下一页</a>　"); 
				 out.print("<a href=search.jsp?key="+Content+"&page="+Tot_page+">尾页</a>　");
				 } 
		      
				} 
			%>
			</div>
            </div>
            <div style="background:url(/ceshi/images/search/content_center_bottom.gif) no-repeat; width:696px; height:27px; "></div>
         </div>
         <div style=" background:url(/ceshi/images/search/content_right.gif) no-repeat; width:163px; height:413px; float:right; "></div>
    </div>
 	<jsp:include page="footer.jsp" />
  </body>
</html>